﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MasterPage : System.Web.UI.MasterPage
{
    KorisnickiDioUtility ut;
    protected void Page_Load(object sender, EventArgs e)
    {
        najnovijiClanciLinkovi.InnerHtml = "";
        ut = new KorisnickiDioUtility();
        UcitajNedavneLinkove();
    }


    /// <summary>
    /// Ucitava linkove na posljednje dodanih 10 clanaka pomocu utiliti metode LinkoviNaNedavneClanke
    /// </summary>
    protected void UcitajNedavneLinkove()
    {
        Dictionary<string, string> d = ut.LinkoviNaNedavneClanke();
        foreach (var clan in d)
        {
            
                najnovijiClanciLinkovi.InnerHtml += "<p class='najnoviji'><a href='" + clan.Key + "'>" + clan.Value + "</a></p>";
        }
    }

    
}
